@echo off
setlocal enabledelayedexpansion

rem 设置当前文件夹路径
set "current_folder=%CD%"

rem 定义要删除的文件后缀名列表
set "file_extensions=.vcxproj .filters .user"

rem 定义要删除的文件夹名称列表
set "folder_names=release debug"

rem 删除指定后缀名的文件
echo Deleting files with specified extensions...
for %%e in (%file_extensions%) do (
    for /r "%current_folder%" %%f in (*%%e) do (
        if exist "%%f" (
            echo Deleting: %%f
            del "%%f"
        )
    )
)

rem 删除指定名称的文件夹
echo Deleting folders with specified names...
for %%n in (%folder_names%) do (
    for /r "%current_folder%" %%d in (%%n) do (
        if exist "%%d" (
            echo Deleting folder: %%d
            rd /s /q "%%d"
        )
    )
)
echo All specified files and folders have been deleted from %current_folder% and its subfolders.
pause